// Change cases of characters
// NEED REDO
class johnCase {
    public static void main(String args[]) 
        throws java.io.IOException {

        int changes = 0;
        char ch;

        System.out.println("Press '.' to stop");

        do {     
            ch = (char) System.in.read();

            if(ch >= 'a' & ch <= 'z') { // The & symbol is pivotal!
                ch -= 32;
                changes++;
                System.out.println(ch);
            }
            else if(ch >= 'A' & ch <= 'Z') {
                ch += 32;
                changes++;
                System.out.println(ch);
            }
        } while(ch != '.');
        System.out.println("A period was pressed!");
        System.out.println("Case changes: " + changes);
    }
}

            

